﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmForumThreads.aspx.cs" Inherits="WCrawler.frmForumThreads" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <asp:Button ID="btnCheckThreads" runat="server" onclick="btnCheckThreads_Click" 
            Text="Check Threads" />
    </div>
    <asp:UpdatePanel ID="ForumThreadPanel" runat="server">
    <ContentTemplate>
    <asp:GridView ID="gridViewForumThreads" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="ForumThreadId"
        DataSourceID="ForumThreadsLinqDataSource" Width="100%" CellPadding="4" 
        ForeColor="#333333" 
        AllowSorting="True" onrowdatabound="gridViewForumThreads_RowDataBound" 
        style="margin-bottom: 0px">
    <EditRowStyle BackColor="#2461BF" />
    <EmptyDataTemplate>
        <asp:Label ID="lblEmptySearch" runat="server" Font-Bold="True" 
                    ForeColor="#0033CC">No Results Found....  
                </asp:Label>
    </EmptyDataTemplate>
    <AlternatingRowStyle BackColor="White" />
    <Columns>
        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
        <asp:TemplateField HeaderText="#" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Label ID="lblNum" Runat="server" />
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center"></ItemStyle>
        </asp:TemplateField>
        <asp:TemplateField HeaderText = "Forum" SortExpression="Forum">
                <ItemTemplate>
                    <asp:HyperLink ID="hyperLinkForum" runat="server" NavigateUrl='<%#Eval("Forum.ForumUrl") + "/" + Eval("Forum.DefaultUrl") %>' Text='<%#Bind("Forum.ForumUrl") %>'> </asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        <asp:TemplateField HeaderText = "Thread Num" SortExpression="ThreadNum">
                <ItemTemplate>
                    <asp:Label ID="lblThreadNum" runat="server" Text='<%#Eval("ThreadNum") %>'></asp:Label>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtThreadNum" runat="server" Text='<%#Bind("ThreadNum") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText = "Thread" SortExpression="Topic">
                <ItemTemplate>
                    <asp:HyperLink ID="hyperLinkThread" runat="server" NavigateUrl='<%#Eval("Forum.ForumUrl") + "/" + Eval("ThreadUrl") %>' Text='<%#Eval("ThreadTitle") %>'> </asp:HyperLink>
                </ItemTemplate>
                <EditItemTemplate>
                    <asp:TextBox ID="txtThreadUrl" runat="server" Text='<%#Bind("ThreadUrl") %>'></asp:TextBox>
                </EditItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText = "Replies" SortExpression="Replies">
                <ItemTemplate>
                    <asp:Label ID="lblReplies" runat="server" Text='<%#Eval("Replies") %>'> </asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText = "Views" SortExpression="Views">
                <ItemTemplate>
                    <asp:Label ID="lblViews" runat="server" Text='<%#Eval("Views") %>'> </asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="CreateOn" HeaderText="CreateOn" 
                SortExpression="CreateOn" />
            <asp:BoundField DataField="UpdateOn" HeaderText="UpdateOn" 
                SortExpression="UpdateOn" />
            <asp:TemplateField HeaderText = "IsAlive" SortExpression="IsAlive" Visible="false">
                <ItemTemplate>
                    <!--<asp:CheckBox Style="color:#368a30;text-decoration:none;" ID="CheckBox1" runat="server" Checked='<%# (DataBinder.Eval(Container.DataItem,"IsAlive") is DBNull ?true:Eval("IsAlive")) %>' TabIndex="1" />-->
                    <asp:CheckBox ID="chkIsAlive" runat="server" Checked='<%#Eval("IsAlive")%>' TabIndex="1" />
                </ItemTemplate>
            </asp:TemplateField>
    </Columns>
    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
    <RowStyle BackColor="#EFF3FB" />
    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
    <SortedAscendingCellStyle BackColor="#F5F7FB" />
    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
    <SortedDescendingCellStyle BackColor="#E9EBEF" />
    <SortedDescendingHeaderStyle BackColor="#4870BE" />
</asp:GridView>
</ContentTemplate>
</asp:UpdatePanel>
<asp:LinqDataSource ID="ForumThreadsLinqDataSource" runat="server" 
        ContextTypeName="WCrawlerLib.LinqDataClassesDataContext" EntityTypeName="" 
        TableName="ForumThreads" EnableDelete="True" EnableUpdate="True">
</asp:LinqDataSource>
</asp:Content>
